package com.Graham.HelloWorld;

import java.util.Scanner;

public class Array {

	Scanner input;

	int index;

	int[] arr;

	public int get_index(int x) {
		System.out.println("How many numbers?");
		x = input.nextInt();

		return x;
	}

	public Array() {//constructor (called on object creation)
		input = new Scanner(System.in);
		index = get_index(index);
		arr = new int[index];
		get_input(arr);
		print_data(arr);
		
	}

	public void get_input(int x[]) {

		for (int i = 0; i < index; i++) {
			System.out.println("Enter a number: ");
			x[i] = input.nextInt();
		}
	}

	public void print_data(int x[]) {
		for (int i = 0; i < index; i++) {
			System.out.println(x[i]);
		}
	}

}
